﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using YunSpace.Application.SiteLibraryManage;
using YunSpace.Core;

namespace YunSpace.Web.Areas.TradingFlow.Controllers
{
    public class TradingManageController : Controller
    {        
        //
        // GET: /TradingFlow/TradingManage/
        OrdersApp odrApp = new OrdersApp();
        public ActionResult Index()
        {
            return View();
        }

        [HttpGet]
        public ActionResult GetGridDataJson(Pagination pagination, string queryJson)
        {
            
            var data = new
            {
                rows = odrApp.GetList(pagination, queryJson),
                total = pagination.total,
                page = pagination.page,
                records = pagination.records
            };
            return Content(data.ToJson());
        }

        [HttpGet]
        public ActionResult ChangeOrderState(string F_Id,string F_Status)
        {
            var LoginInfo = OperatorProvider.Provider.GetCurrent();
            return Content(odrApp.ChangeDataState(F_Id,F_Status, LoginInfo.UserId).ToString());
        }
    }
}
